#pragma once

#include "LoggedTestSuite.h"

//#define INFINITE_WAITS

namespace CO { namespace SpiFoundation { namespace RoomFW {

class SendMessageErrorTestSuite : public LoggedTestSuite
{
public:
	SendMessageErrorTestSuite();
	
protected:

	virtual void setup();
	virtual void tear_down();

private:

	static const DWORD DWait = 
#ifdef INFINITE_WAITS
		INFINITE;
#else
		2000;
#endif

	//enum Reason
	//{
	//	SMER_NONE,					// No error.
	//	SMER_INVALID_PORT,			// Invalid port index.
	//	SMER_PORT_NOT_BOUND,		// Valid port index, but not bound.
	//	SMER_RECEIVER_ERRORED,		// The recipient of the message is in an errored state.
	//	SMER_BROADCAST_PAYLOAD,		// Attempt to broadcast a payload.  Not allowed.
	//	SMER_BROADCAST_INVOKE,		// Attempt to broadcast an invoke.  Not allowed.
	//	SMER_CONTRACT_VIOLATION,	// Message does not comply with contract (protocol) specified port's protocol.
	//	SMER_REPLY_TO_REPLY,		// Attempt to reply to a message that was sent by reply.  Not allowed.
	//	SMER_INVOKE_TIMEOUT,		// An invoke timed out and the call specified (or defaulted) to handle it with an exception.
	//	SMER_REPLY_TIMEOUT,			// Attempted to reply to a message after the caller timed out waiting for response.
	//	SMER_COUNT	// MUST BE LAST VALUE!!!  Number of errors.  Used for testing.
	//};

	void empty(void);
	void testEndpoints(void);
	void testMessageHandler(void);
	void testReasons(void);
	void testPortals(void);
};

}}}
